# encoding=utf-8
# author:梁子龙
from sqlalchemy import String
from sqlalchemy.orm import mapped_column, Mapper

from db import DBModelBase


class UserModel(DBModelBase):
    """
    用户模型类
    """
    username: Mapper[str] = mapped_column(String(20), unique=True, nullable=False)
    password: Mapper[str] = mapped_column(String(256), nullable=False)
    phone: Mapper[str] = mapped_column(String(20), nullable=True)
    email: Mapper[str] = mapped_column(String(50), nullable=True)
    real_name: Mapper[str] = mapped_column(String(50), nullable=True)
    icon: Mapper[str] = mapped_column(String(100), default="/static/user_icon/default.jpg", nullable=True)
